ActiveReports 9 > ActiveReports User Guide > Samples and Walkthroughs > Samples > Professional > ActiveReports with MVC |
The ActiveReports9 with MVC sample demonstrates an MVC web application with the ActiveReports Web Viewer. This Sample is part of the ActiveReports Professional Edition.
Note: Before running this sample, you must first install the ASP.NET MVC 3 framework on your machine. |
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\ActiveReportsWithMVC\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\ActiveReportsWithMVC\C#
Runtime Features
When you run the project, the page with the Customer Index view appears. On this page, you can click a customer in the list to open a new page with the Customer Details information. At the bottom of the page, there are two links - Freight Summary (section report) and Order Summary (page report). Clicking the Freight Summary (section report) link opens a page with the OrderReport report. Clicking the Order Summary (page report) link opens a page with the OrderDetailsReport.rdlx report.
Project Details
Controllers
DBContext
Models
This folder contains the following classes.
Customer - a container for the rows in the Customers table of NWind.mdb.
Order - a container for the rows in the Orders table of NWind.mdb.
OrderDetails - a container for the rows in the Order Details table of NWind.mdb.
ReportDescriptor - the class representation of the ReportType (section or page layout) and the CustomerID.
Repository - a container for data required by the application.
Reports
OrderDetailsReport.rdlx: This report uses the object provider to connect to data at runtime. It uses the Table data region to display order details and the Plain Line chart to display sales by order id. The Table data is grouped by OrderID. Some TextBox controls of the Table use the Sum function to display the total price information for each order.
This is the report that opens in a separate view when you click the Order Summary (page report) link on the Customer Details page.
OrderReport: This report binds to data at runtime. The report uses the Textbox and Label controls to display the order details and the Bar chart to display the freight amounts by ship date.
This is the report that opens in a separate view when you click the Freight Summary (section report) link on the Customer Details page.
Views
Home folder
This folder contains the following views.
_Layout.cshtml. The default layout file.
_ViewStart.cshtml. The default view start file.
Details.cshtml. The Customer Details view file.
Index.cshtml. The Index view file.
StartPage.cshtml. The template for the Index view.
Viewer.cshtml. The template for the section report and page report views.
WebViewer.ascx. The form that contains the ActiveReports WebViewer control.
Web.config
The configuration file that contains the httpHandlers that allow ActiveReports to process view pages on the Web.
ActiveReports.ReportService.asmx
The report web service required for the proper functioning of the Web Viewer. The ActiveReports.ReportService.asmx is added automatically to the project when you place the Viewer control on the form. You can also can add this service by using Add New Item in the Visual Studio 2010 Project menu.
Global.asax
Web.config
The configuration file that contains the httpHandlers that allow ActiveReports to process this web application.
Note that you need to manually update version information here when you update your version of ActiveReports.